package com.igeek.boot.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.igeek.boot.entity.ZhrjAlarmInfo;
import com.igeek.boot.entity.ZhrjAlarmInfoCustom;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @package com.igeek.boot.mapper
 * @Description 扩展查询类
 * @Author LittlePunk [296526219@qq.ccom]
 * @Version 2022.1
 * @Date 2023/12/12 22:22
 */

/*
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.igeek.boot.mapper.ZhrjAlarmInfoCustomMapper">
    <resultMap id="findAllByInfoAndDeptId" type="zhrjAlarmInfoCustom">
        <id property="deptId" column="dept_id"/>
        <association property="zhrjDeptCustom" javaType="zhrjDeptCustom">
            <result property="deptName" column="dept_name"/>
            <collection property="zhrjMenuList" ofType="ZhrjMenu">
                <result property="menuDescription" column="menu_description"/>
            </collection>
        </association>
    </resultMap>
    <select id="findAllByDeptId" parameterType="int" resultMap="findAllByInfoAndDeptId">
        SELECT a.id,a.dept_id,a.wan_ip,a.event_time,a.event_type,a.event_status,a.event_reasons,
               d.dept_id,d.parent_id,d.ancestors,d.dept_name,d.dept_no,d.order_num,
               m.menu_name, m.actual_value, m.display_value, m.menu_description
        FROM zhrj_alarm_info a , zhrj_dept d , zhrj_menu m
        where a.dept_id = d.dept_id and d.order_num = m.actual_value
        and a.dept_id=#{id}
    </select>
</mapper>
 */
@Mapper
public interface ZhrjAlarmInfoCustomMapper extends BaseMapper<ZhrjAlarmInfoCustom> {


    //public List<ZhrjAlarmInfoCustom> findAllByDeptId(Integer id);

    public List<ZhrjAlarmInfoCustom> findAllByDeptId(Integer id);
}
